
package com.zy.ems.model;

import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;

import com.zy.ems.common.base.BaseEntity;

public class UserEntity extends BaseEntity {
    private static final long serialVersionUID = 1L;


    /**
     * 用户ID(db_column: id)
     */
    private Integer id;

    /**
     * 登录名(db_column: user_name)
     */
    private String userName;

    /**
     * 真实姓名(db_column: real_name)
     */
    private String realName;

    /**
     * 密码(db_column: password)
     */
    private String password;

    /**
     * 手机号(db_column: mobile)
     */
    private Integer mobile;

    /**
     * 联系方式(db_column: telephone)
     */
    private String telephone;

    /**
     * 创建时间(db_column: create_time)
     */
    private Integer createTime;

    /**
     * 更新时间(db_column: update_time)
     */
    private Integer updateTime;

    /**
     * 邮箱地址(db_column: email)
     */
    private String email;

    /**
     * 上次登录时间(db_column: last_login_time)
     */
    private Integer lastLoginTime;

    /**
     * 上次登录IP(db_column: last_login_ip)
     */
    private String lastLoginIp;

    /**
     * 启用状态（1:启用，0:禁用)(db_column: status)
     */
    private Boolean status;


    public UserEntity(){
    }

    public UserEntity(
            Integer id
            ){
        this.id = id;
    }


    public Integer getId() {
        return this.id;
    }

    public void setId(Integer value) {
        this.id = value;
    }

    public String getUserName() {
        return this.userName;
    }

    public void setUserName(String value) {
        this.userName = value;
    }

    public String getRealName() {
        return this.realName;
    }

    public void setRealName(String value) {
        this.realName = value;
    }

    public String getPassword() {
        return this.password;
    }

    public void setPassword(String value) {
        this.password = value;
    }

    public Integer getMobile() {
        return this.mobile;
    }

    public void setMobile(Integer value) {
        this.mobile = value;
    }

    public String getTelephone() {
        return this.telephone;
    }

    public void setTelephone(String value) {
        this.telephone = value;
    }

    public Integer getCreateTime() {
        return this.createTime;
    }

    public void setCreateTime(Integer value) {
        this.createTime = value;
    }

    public Integer getUpdateTime() {
        return this.updateTime;
    }

    public void setUpdateTime(Integer value) {
        this.updateTime = value;
    }

    public String getEmail() {
        return this.email;
    }

    public void setEmail(String value) {
        this.email = value;
    }

    public Integer getLastLoginTime() {
        return this.lastLoginTime;
    }

    public void setLastLoginTime(Integer value) {
        this.lastLoginTime = value;
    }

    public String getLastLoginIp() {
        return this.lastLoginIp;
    }

    public void setLastLoginIp(String value) {
        this.lastLoginIp = value;
    }

    public Boolean getStatus() {
        return this.status;
    }

    public void setStatus(Boolean value) {
        this.status = value;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("Id", getId())
            .append("UserName", getUserName())
            .append("RealName", getRealName())
            .append("Password", getPassword())
            .append("Mobile", getMobile())
            .append("Telephone", getTelephone())
            .append("CreateTime", getCreateTime())
            .append("UpdateTime", getUpdateTime())
            .append("Email", getEmail())
            .append("LastLoginTime", getLastLoginTime())
            .append("LastLoginIp", getLastLoginIp())
            .append("Status", getStatus())
            .toString();
    }

    @Override
    public int hashCode() {
        return new HashCodeBuilder()
            .append(getId())
            .toHashCode();
    }

    @Override
    public boolean equals(Object obj) {
        if(!(obj instanceof UserEntity)) {
            return false;
        }
        if(this == obj) {
            return true;
        }
        UserEntity other = (UserEntity) obj;
        return new EqualsBuilder()
            .append(getId(), other.getId())
            .isEquals();
    }
}

